<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@include file="/context/mytags.jsp" %>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<link rel="stylesheet" href="plug-in/uploadify/css/uploadify.css" type="text/css"/>
<script type="text/javascript" src="plug-in/uploadify/jquery.uploadify-3.1.min.js"></script>
<script type="text/javascript" src="plug-in/jquery/jquerysession.js"></script>
<html>
<head>
    <title>物流发货</title>
</head>
<script>

    function lookImg(obj) {
        addOneTab('预览', 'cbsServiceController.do?openViewFile&fileid=' + obj.id)
    }

    $("#btn").css("pointer-events", "auto");
    $(function () {
        $(".typeId").hide();
        $("#etaStandard").hide();
        $("#btn2").hide();
    })

    function copyKw() {
        var kw = $(".KW").val();
        $(".KW").find("option[value = '" + kw + "']").attr("selected", "selected");
    }

    function copyWl() {

        var wl = $(".WL").val();
        $(".WL").val(wl);
    }

    function chooseWarhouse(index) {
        var logistics = $("#logistics").val();
        $.session.set("index", index);
        $.dialog({
            content: "url:cbsWarehouseController.do?zyChooseWa&logistics=" + logistics,
            zIndex: 2100,
            title: '选择仓库',
            lock: true,
            width: '300px',
            height: '500px',
            left: '85%',
            top: '65%',
            opacity: 0.4,
            init: function () {
                top.myWindow = window;
            },
            button: [{
                name: '确认',
                callback: function () {
                    var cinemaName = $.session.get("name");
                    // $("#city"+index+"").text(cinemaName);
                    $(".city").text(cinemaName);
                    $.session.clear();
                },
                focus: true
            }, {
                name: '返回',
                callback: function () {
                }
            }]
        });
    }

    //判断当前选择时间是否小于是当前实际时间
    function contrastTime(start) {
        var evalue = document.getElementById(start).value;
        var dB = new Date(evalue.replace(/-/g, "/"));//获取当前选择日期
        var d = new Date();
        var str = d.getFullYear() + "-" + (d.getMonth() + 1) + "-" + d.getDate();//获取当前实际日期
        if (Date.parse(str) > Date.parse(dB)) {//时间戳对比
            return 1;
        }
        return 0;
    }

    function changeTime() {
        var changeTimeReason = $("#changeTimeReason").val();

        if (changeTimeReason != "") {
            parent.window.tip("只能修改一次到货时间");
            return false;
        }
        var time = $("#time").val();
        var id = $("#cbsDelinerPageID").val();
        var cellphone = $("#cellphone").val();
        if (time == "") {
            parent.window.tip("预计到货时间不能为空，请先填写预计到货时间");
            return false;
        }
        $.dialog({
            content: "url:cbsDelinerController.do?goChangeTime",
            zIndex: 2100,
            title: '填写备注',
            lock: true,
            width: '800px',
            height: '500px',
            left: '85%',
            top: '65%',
            opacity: 0.4,
            init: function () {
                top.myWindow = window;
            },
            button: [{
                name: '确认',
                callback: function () {
                    var remarks = $.session.get("remarks");

                    if (typeof(remarks) == "undefined") {
                        parent.window.tip("必须填写修改原因");
                        // return false;
                    }
                    if (typeof(remarks) != "undefined") {
                        $.ajax({
                            type: "post",
                            dataType: "json",
                            data: {"remarks": remarks, "id": id, "time": time, "cellPhone": cellphone},
                            url: "cbsDelinerController.do?changeTime",
                            success: function (data) {
                                var attr = data.attributes;
                                if (attr.sta == 1) {
                                    parent.window.tip("修改成功");
                                    setTimeout("  addOneTab(\"发货管理\",'cbsDelinerController.do?cbsDeliner');", 1000);
                                    setTimeout("closetab('物流发货')", 1000);
                                    $.session.remove('remarks');
                                    $.session.clear();
                                }
                            }
                        })
                    }
                },
                focus: true
            }, {
                name: '返回',
                callback: function () {
                }
            }]
        });
    }

    function Wlsend2() {
        var CSASendTime = $("#CSASendTime").val();
        var time = $("#time").val();
        var fhSLA = $("#fhSLA").val();
        if (time.length == 0 || time == '') {
            tip("请填写预计到货时间");
            return false;
        }
        if (fhSLA == '当天到') {
            $.ajax({
                type: "post",
                dataType: "json",
                data: {"time": time, "CSASendTime": CSASendTime},
                url: "cbsDelinerController.do?compareTimeForDay",
                success: function (data) {
                    var b = data.success;
                    if (b) {
                        Wlsend();
                    } else {
                        $("#btn2").show();
                        $("#etaStandard").show();
                        $("#btn").hide();
                    }
                }
            })
        }
        if (fhSLA == '普通') {
            $.ajax({
                type: "post",
                dataType: "json",
                data: {"time": time, "CSASendTime": CSASendTime, "sla": "pt", "type": "send"},
                url: "cbsDelinerController.do?ifQualified",
                success: function (data) {
                    var slaType = $("#slaType").val();
                    var obj = data.attributes;
                    if (slaType != '') {
                        if (obj.status > slaType) {
                            $("#etaStandard").show();
                            $("#btn2").show();
                            $("#btn").hide();
                        } else {
                            Wlsend();
                        }
                    }
                }
            })
        }
        if (fhSLA == '加急') {
            $.ajax({
                type: "post",
                dataType: "json",
                data: {"time": time, "CSASendTime": CSASendTime, "type": "sendJi"},
                url: "cbsDelinerController.do?ifQualified",
                success: function (data) {
                    var slaType = $("#slaType").val();
                    var obj = data.attributes;
                    if (slaType != '') {
                        if (obj.status > slaType) {
                            $("#etaStandard").show();
                            $("#btn2").show();
                            $("#btn").hide();
                        } else {
                            Wlsend();
                        }
                    }
                }
            })
        }
    }

    function Wlsend() {
        $("#btn").css("pointer-events", "none");
        var bool = true;
        var obj = new Object();
        var items = [];
        var sn = [];
        var code = [];
        var city = [];
        var kw = [];
        var number = [];
        var weight = [];
        var equipmentId = [];
        $("select[name='zyEsItem']").find("option:selected").each(function () {
            items.push($(this).val());
        });
        $("select[name='kw']").find("option:selected").each(function () {
            kw.push($(this).val());
        });
        $("input[name='sn']").each(function () {
            sn.push($(this).val());
            if ($(this).val() == "") {

                bool = false;
            }
        });
        if (bool == false) {
            parent.window.tip("必须填写备件序列号的备件");
            $("#btn").css("pointer-events", "auto");
            return false;
        }
        $("input[name='equipmentId']").each(function () {
            equipmentId.push($(this).val());
        });
        $("input[name='code']").each(function () {
            code.push($(this).val());
        });
        $(".city").each(function () {
            city.push($(this).text());
        });
        $(".WL").each(function () {
            number.push($(this).val());
            if ($(this).val() == '') {
                //alert(this.id)
                $('#' + this.id + 'Err').show()
            }
        });

        if ($("#time").val() == null || $("#time").val() == '') {
            $('#timeErr').show()
            return false;
        }
        $(".weight").each(function () {
            weight.push($(this).val());
        });
        var id = $("#cbsDelinerPageID").val();
        var time = $("#time").val();
        var memo = $("#memo").val();
        obj.id = $("#cbsDelinerPageID").val();
        obj.time = $("#time").val();
        obj.memo = $("#memo").val();
        obj.items = items;
        obj.sns = sn;
        obj.codes = code;
        obj.numbers = number;
        obj.weights = weight;
        obj.kws = kw;
        obj.citys = city;
        obj.equipmentIds = equipmentId;
        obj.fileId = $("#fileName").val();
        obj.cellPhone = $("#cellphone").val();
        var ret = contrastTime("time");
        if (ret == 1) {
            parent.window.tip("预计到货时间不得早于当前时间");
            $("#time").val('');
            $("#btn").css("pointer-events", "auto");
            return false;
        }
        var stayus = $("#status").val();
        if (stayus >= 6) {
            parent.window.tip("该单已发货");
            $("#btn").css("pointer-events", "auto");
            return false;
        }
        $.ajax({
            type: "post",
            dataType: "json",
            traditional: true,
            data: obj,
            url: "cbsDelinerController.do?WlSend",
            success: function (data) {
                var obj = data.attributes;
                if (obj.sta == 1) {
                    parent.window.tip("发货成功");
                    setTimeout("  addOneTab(\"发货管理\",'cbsDelinerController.do?cbsDeliner');", 1000);
                    setTimeout("closetab('物流发货')", 1000);
                } else {
                    parent.window.tip("发货失败");
                    $("#btn").css("pointer-events", "auto");
                }
            }
        })
    }

    function WlsendAndMemo() {
        $("#btn").css("pointer-events", "none");
        var etaQunqualified = $("#etaQunqualified").val();
        if (etaQunqualified == "0") {
            parent.window.tip("请选择延迟原因");
            return false;
            $("#btn").css("pointer-events", "auto");
        }
        var etaNotQualifiedMemo = $("#etaNotQualifiedMemo").val();
        if (etaNotQualifiedMemo.length == 0 && etaNotQualifiedMemo == "") {
            parent.window.tip("请填写延迟备注");
            return false;
            $("#btn").css("pointer-events", "auto");
        }
        var bool = true;
        var obj = new Object();
        var items = [];
        var sn = [];
        var code = [];
        var city = [];
        var kw = [];
        var number = [];
        var weight = [];
        var equipmentId = [];
        $("select[name='zyEsItem']").find("option:selected").each(function () {
            items.push($(this).val());
        });
        $("select[name='kw']").find("option:selected").each(function () {
            kw.push($(this).val());
        });
        $("input[name='sn']").each(function () {
            sn.push($(this).val());
            if ($(this).val() == "") {

                bool = false;
            }
        });
        if (bool == false) {
            parent.window.tip("必须填写备件序列号的备件");
            $("#btn").css("pointer-events", "auto");
            return false;
        }
        $("input[name='equipmentId']").each(function () {
            equipmentId.push($(this).val());
        });
        $("input[name='code']").each(function () {
            code.push($(this).val());
        });
        $(".city").each(function () {
            city.push($(this).text());
        });
        $(".WL").each(function () {
            number.push($(this).val());
            if ($(this).val() == '') {
                //alert(this.id)
                $('#' + this.id + 'Err').show()
            }
        });

        if ($("#time").val() == null || $("#time").val() == '') {
            $('#timeErr').show()
            return false;
        }
        $(".weight").each(function () {
            weight.push($(this).val());
        });
        var id = $("#cbsDelinerPageID").val();
        var time = $("#time").val();
        var memo = $("#memo").val();
        obj.id = $("#cbsDelinerPageID").val();
        obj.time = $("#time").val();
        obj.memo = $("#memo").val();
        obj.items = items;
        obj.sns = sn;
        obj.codes = code;
        obj.numbers = number;
        obj.weights = weight;
        obj.kws = kw;
        obj.citys = city;
        obj.equipmentIds = equipmentId;
        obj.fileId = $("#fileName").val();
        obj.cellPhone = $("#cellphone").val();
        obj.etaQunqualified = $("#etaQunqualified").val();
        obj.etaNotQualifiedMemo = $("#etaNotQualifiedMemo").val();
        var ret = contrastTime("time");
        if (ret == 1) {
            parent.window.tip("预计到货时间不得早于当前时间");
            $("#time").val('');
            $("#btn").css("pointer-events", "auto");
            return false;
        }
        var stayus = $("#status").val();
        if (stayus >= 6) {
            parent.window.tip("该单已发货");
            $("#btn").css("pointer-events", "auto");
            return false;
        }
        $.ajax({
            type: "post",
            dataType: "json",
            traditional: true,
            data: obj,
            url: "cbsDelinerController.do?WlSend",
            success: function (data) {
                var obj = data.attributes;
                if (obj.sta == 1) {
                    parent.window.tip("发货成功");
                    setTimeout("  addOneTab(\"发货管理\",'cbsDelinerController.do?cbsDeliner');", 1000);
                    setTimeout("closetab('物流发货')", 1000);
                } else {
                    parent.window.tip("发货失败");
                    $("#btn").css("pointer-events", "auto");
                }
            }
        })
    }

    $(function () {
        var cbsDeliverId = $("#cbsDelinerPageID").val();
        $("#uploadFile").uploadify({
            buttonText: '上传文件',
            auto: true,
            progressData: 'speed',
            multi: true,
            height: 20,
            width: 60,
            overrideEvents: ['onDialogClose'],
            queueID: 'instructionfile',
            /*fileTypeDesc : '文件格式:',
            fileTypeExts : '*.*',*/
            fileTypeDesc: '支持格式:*',
            fileTypeExts: '*', //控制可上传文件的扩展名，启用本项时需同时声明fileDesc
            fileSizeLimit: '50MB',
            swf: 'plug-in/uploadify/uploadify.swf',
            uploader: '<%=basePath%>/cbsDelinerController.do?uploadFile&businessType=L&cbsDeliverId=' + cbsDeliverId + '&sessionId=' + $("#sessionId").val() + '',
            onUploadStart: function () {
                lockmask(true, '请稍等,导入中...');
            }, onUploadSuccess: function (file, data) {
                lockmask(false);
                var json = $.parseJSON(data).attributes;
                var fileIds = $("#fileId").val();
                var html = '<span id="li_file_' + json.id + '"><span class="color-blue" onclick="lookImg(this)" id="' + json.id + '">' + json.name + '</span>&nbsp;&nbsp; ' +
                    '<span style="cursor: pointer;" onclick=\'delFile("' + json.id + '")\'>[删除]</span></span>'

                $("#file").prepend(html);
                $("#fileName").val(json.id);
                // parent.window.tip("上传成功！");
            }, onFallback: function () {
                parent.window.tip("您未安装FLASH控件，无法上传文件！请安装FLASH控件后再试");
            }, onSelectError: function (file, errorCode, errorMsg) {
                switch (errorCode) {
                    case -100:
                        parent.window.tip("上传的文件数量已经超出系统限制的" + $('#instruction').uploadify('settings', 'queueSizeLimit') + "个文件！");
                        break;
                    case -110:
                        parent.window.tip("文件 [" + file.name + "] 大小超出系统限制的50MB大小！");
                        break;
                    case -120:
                        parent.window.tip("文件 [" + file.name + "] 大小异常！");
                        break;
                    case -130:
                        parent.window.tip("文件 [" + file.name + "] 类型不正确！");
                        break;
                }
            }
        });
    });

    function delFile(id) {
        var flag = true;
        $.ajax({
            url: "cbsDelinerController.do?delFile",
            data: {
                "id": id
            },
            cache: false,
            dataType: 'json',
            type: 'POST',
            async: false,
            success: function (data) {
                if (!data.success) {
                    flag = false;
                    parent.window.tip(data.msg);
                } else {
                    parent.window.tip(data.msg);
                    //隐藏标签
                    $("#li_file_" + id + "").remove();
                    $("#repairFrontFile").val("");
                }
            }
        });
    }


    function checkeNull(obj) {
        var value = obj.value;
        if (value == null || value == '') {
            $('#' + obj.id + 'Err').show();
        } else {
            $('#' + obj.id + 'Err').hide();
        }
    }
</script>
<body>
<div style="margin-bottom:10px;">
    <img style="margin-bottom:-7px" src="plug-in/login/images/dispatch bill.png">
    <span class="list-title">${cbsDelinerPage.code}</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <span style="font-size:13px;">状态：<span class="color-red">${deliverStatus.typename}</span></span>
    <div style="position: absolute; text-align: center; width: 100%; margin-top:-20px;">
        <%--<a href="#" class="easyui-linkbutton l-btn">保存</a>--%>
    </div>
</div>
<input type="hidden" id="cbsDelinerPageID" value="${cbsDelinerPage.id}"/>
<input type="hidden" id="sessionId" value="${pageContext.session.id}">
<input type="hidden" id="changeTimeReason" value="${cbsDelinerPage.changeTimeReason}"/>
<input type="hidden" id="status" value="${cbsDelinerPage.status}"/>
<input type="hidden" value="${slaType}" id="slaType"/>
<div class="subtitle">
    <p>关联信息</p>
    <table class="nobordertable noborder">
        <tbody>
        <tr>
            <td class="al_r" width="20%">
                <label>服务单号CR:</label>
            </td>
            <td width="30%">
                ${cbsDelinerPage.crCode}
            </td>
            <td class="al_r" width="20%">
                <label>备件申请单号:</label>
            </td>
            <td width="30%">
                ${cbsDelinerPage.spaceNumber}
            </td>
        </tr>
        <tr>
            <td class="al_r" width="20%">
                <label>SR:</label>
            </td>
            <td width="30%">
                ${cbsDelinerPage.srCode}
            </td>
            <td class="al_r" width="20%">
                <label>SO:</label>
            </td>
            <td width="30%">
                ${cbsDelinerPage.soCode}<input type="hidden" id="logistics" value="${cbsDelinerPage.deliverLogistics}"/>
            </td>
        </tr>
                <tr>
			 <td class="al_r" width="20%">
				 <label>发货单类型:</label>
			 </td>
			 <td width="30%">
				 <c:forEach items="${deliverTypeList}" var="tsType">
					 <c:if test="${tsType.typecode==cbsDelinerPage.deliverType}">
						 <label>${tsType.typename}</label>
					 </c:if>
				 </c:forEach>
			 </td>
			 <td class="al_r" width="20%">

			 </td>
			 <td width="30%">

			 </td>
		 </tr>
        </tbody>
    </table>
</div>
<div class="subtitle">
    <p>发货申请</p>
    <table class="ftable">
        <tbody class="et">
        <tr>
            <th>备件类型</th>
            <th>备件号</th>
            <th>数量</th>
            <th>是否返件</th>
            <th>序列号</th>
            <th>二维码</th>
            <th>仓库</th>
            <th>库位</th>
            <th>物流单号</th>
            <th>计费重量(KG)</th>
        </tr>
        <c:forEach items="${deliverEquipmentList}" var="deliverEquipment" varStatus="index">
            <tr>
                <td id="tyepe${index.index}" class="typee">
                    <input type="hidden" value="${deliverEquipment.id}" name="equipmentId">${deliverEquipment.typeDes}</td>
                <td style="width: 150px" class="typeId">${deliverEquipment.typeId.id}</td>
                <td style="width: 150px">
                    <select style="width: 80%;" name="zyEsItem" class="select${index.index}" id="bjh" disabled="true">
                        <option selected="selected" value="${deliverEquipment.item}">${deliverEquipment.item}</option>
                    </select>
                </td>
                <td>${deliverEquipment.total}</td>
                <td>
                    <c:if test="${deliverEquipment.isReturn==2}">是</c:if>
                    <c:if test="${deliverEquipment.isReturn!=2}">否</c:if>
                </td>
                <td><input style="width:  80%;" class="SN" name="sn" id="sn" value="${deliverEquipment.deliverSn}"/>
                </td>
                <td><input style="width:  80%;" id="code" name="code" class="code" value="${deliverEquipment.deliverErcode}"/></td>
                <td style="width: 130px">
                    <input type="hidden" value="${index.index}" id="index"/>
                    <span id="city${index.index}" class="city">${deliverEquipment.deliverId.deliverWarehouseId.name}</span>&nbsp;
                    <span class="color-blue" onclick="chooseWarhouse(${index.index})">[修改]</span></td>
                <td style="width: 130px">
                    <span style="color: red">*</span>
                    <select style="width:  80%;" class="KW" name="kw" id="kw" <c:if test="${index.index==0}"> onchange="copyKw()"</c:if>>
                        <c:if test="${deliverStatus.typename!='物流待发货'}">
                            <c:forEach items="${types}" var="types" >
                                <option value="${types.typecode}"<c:if test="${types.typecode == deliverEquipment.wLocaltion}">selected="selected"</c:if>>${types.typename}</option>
                            </c:forEach>
                        </c:if>
                        <c:if test="${deliverStatus.typename=='物流待发货'}">
                            <c:forEach items="${types}" var="types" >
                                <option value="${types.typecode}"<c:if test="${types.typecode == cbsDelinerPage.wLocaltion}">selected="selected"</c:if>>${types.typename}</option>
                            </c:forEach>
                        </c:if>
                    </select>
                </td>
                <td>
                    <input name="WLCode" style="width:  80%;" class="WL" id="dh${deliverEquipment.id}" value="${deliverEquipment.logisticsNumber}" <c:if test="${index.index==0}">onchange="copyWl()"</c:if> /><br>
                </td>
                <td><input style="width:  80%;" id="weight" class="weight" value="${deliverEquipment.weight}"/></td>
            </tr>
        </c:forEach>
        </tbody>
    </table>
    <div style="margin-top:20px; width: 98%; margin: 10px auto;"><span style="font-weight: bold;">说明</span></div>
    <div class="line"></div>
    <table class="nobordertable noborder" style="border: none;">
        <tbody>
        <tr>
            <td class="al_r" width="20%">
                <label>发货说明:</label>
            </td>
            <td width="30%">
                ${cbsDelinerPage.deliverDes}
            </td>

        </tr>
        <tr>
            <td class="al_r" width="20%">
                <label>备件申请人:</label>
            </td>
            <td width="30%">
                <c:if test="${Hb == '1'}">
                    <c:choose>
                        <c:when test="${list!= null}">
                            <c:forEach items="${list}" var="mymap" varStatus="index">
                                ${mymap.shortname}&nbsp;&nbsp; ${mymap.name}&nbsp;&nbsp; ${mymap.phone}<br>
                            </c:forEach>
                        </c:when>
                        <c:otherwise>
                            ${shortname}&nbsp;&nbsp;${cbsEquipmentApplyEntity.createName}&nbsp;&nbsp;${mobilePhone}
                        </c:otherwise>
                    </c:choose>
                </c:if>
                <c:if test="${Hb == '2'}">
                    ${shortname}&nbsp;&nbsp;${cbsEquipmentApplyEntity.createName}&nbsp;&nbsp;${mobilePhone}
                </c:if>
            </td>
            <td class="al_r" width="20%">
                <label>服务工程师:</label>
            </td>
            <td width="30%">
                ${engineer.belongOrg.departname}&nbsp;&nbsp; ${engineer.name}&nbsp;&nbsp;${engineer.cellphone}
                <input type="hidden" id="cellphone" value="${engineer.cellphone}">
                <%--${engineer.cellphone}--%>
            </td>
        </tr>
        </tbody>
    </table>
</div>
<div class="subtitle">
    <p>收货人信息</p>
    <table class="nobordertable noborder" style="border: none;">
        <tbody>
        <tr>

            <td class="al_r" width="20%">
                <label>是否自提:</label>
            </td>
            <td colspan="3">
                <c:if test="${cbsDelinerPage.zt==1}">是</c:if>
                <c:if test="${cbsDelinerPage.zt==2}">否</c:if>
            </td>

        </tr>
        <tr>
            <td class="al_r" width="20%">
                <label>姓名:</label>
            </td>
            <td width="30%">
                ${cbsDelinerPage.userName}
            </td>
            <td class="al_r" width="20%">
                <label>电话:</label>
            </td>
            <td width="30%">
                ${cbsDelinerPage.phone}
            </td>
        </tr>
        <tr>
            <td class="al_r" width="20%">
                <label>收货地址:</label>
            </td>
            <td width="30%">
                ${cbsDelinerPage.sheng.territoryName} ${cbsDelinerPage.shi.territoryName} ${cbsDelinerPage.address}
            </td>
            <td class="al_r" width="20%">
                <label>影院名称:</label>
            </td>
            <td width="30%">
                ${cbsDelinerPage.cinemaName}
            </td>
        </tr>
        <c:if test="${cbsDelinerPage.zt==1}">
            <tr>
                <td class="al_r"><label>自提仓库:</label></td>
                <td colspan="3">
                        ${cbsDelinerPage.warehouseId.shi.territoryName}
                    &nbsp;&nbsp;
                        <%--<span>北京市顺义区李桥镇XXX</span>--%>
                </td>
            </tr>
        </c:if>
        </tbody>
    </table>
</div>
<div class="subtitle">
    <p>物流</p>
    <table class="nobordertable noborder" style="border: none;">
        <tbody>
        <tr>
            <td class="al_r" width="20%">
                <label>发货SLA:</label>
            </td>
            <td width="30%">
                ${fhSLA.typename}<input type="hidden" id="fhSLA" value="${fhSLA.typename}"/>
            </td>
            <td class="al_r" width="20%">
                <label>提货地址:</label>
            </td>
            <td width="30%">
                <c:if test="${cbsDelinerPage.thSheng!=null}">
                    ${cbsDelinerPage.thSheng.territoryName}&emsp;
                </c:if>
                <c:if test="${cbsDelinerPage.thCity!=null}">
                    ${cbsDelinerPage.thCity.territoryName}&emsp;
                </c:if>
                <c:choose>
                    <c:when test="${cbsDelinerPage.thAddress!= null && cbsDelinerPage.thAddress!=''}">
                        ${cbsDelinerPage.thAddress}
                    </c:when>

                    <c:otherwise>
                        无
                    </c:otherwise>
                </c:choose>
            </td>
        </tr>
        <tr>
            <td class="al_r" width="20%">
                <label>预计到货时间:</label>
            </td>
            <td width="30%">
                <input type="hidden" value="${cbsDelinerPage.CSASendTime}" id="CSASendTime"/>
                <font color="red">*</font><input class="Wdate"
                                                 value="<fmt:formatDate value="${cbsDelinerEntityList.expectTime}" pattern="yyyy-MM-dd HH:mm:00"/>"
                                                 onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:00'})" id="time"
                                                 onblur="checkeNull(this)"/>
                &emsp;<span id="timeErr" hidden="hidden" style="color: red;font-size: 10px">预计到货时间不能为空</span>
                <c:if test="${cbsDelinerEntityList.status ne '7'}">
                    <c:if test="${cbsDelinerEntityList.logisticsSendTime !=null}">
                        <span class="color-blue" onclick="changeTime()">[修改]</span></c:if>
                </c:if>
            </td>
            <td class="al_r" width="20%">
                <label>物流承诺时效:</label>
            </td>
            <td width="30%">
                ${cbsDelinerPage.wlSLA}
            </td>
        </tr>
        <tr>
            <td class="al_r" valign="top"><label>物流发货备注:</label></td>
            <td colspan="3">
                <textarea style="width:100%; height: 60px;" id="memo">${cbsDelinerEntityList.logisticsMemo}</textarea>
            </td>
        </tr>
        <tr>
            <td colspan="4">
                <div style="text-align: center; margin: 10px auto;">
                    <a onclick="Wlsend2()" id="btn" class="easyui-linkbutton l-btn">发货</a>
                    <a onclick="WlsendAndMemo()" id="btn2" class="easyui-linkbutton l-btn">发货</a>
                </div>
            </td>
        </tr>
        <tr id="etaStandard">
            <td class="al_r" width="20%">
                <label style="color: red">ETA延迟，请选择延迟原因。</label>
            </td>
        </tr>

        <tr>
            <td class="al_r" width="20%">
                <label>延迟原因:</label>
            </td>
            <td width="30%">
                <font color="red">*</font>
                <select id="etaQunqualified" style="width: auto">
                    <option value="0">--请选择--</option>
                    <c:forEach items="${etaStandardList}" var="etaStandard">
                        <option value="${etaStandard.typename}"
                                <c:if test="${cbsDelinerPage.etaQunqualified == etaStandard.typename}">selected="selected"</c:if>>${etaStandard.typename}</option>

                    </c:forEach>
                    <%--<option <c:if test="${cbsDelinerPage.notQualified == '站点原因'}">selected="selected"</c:if>>站点原因</option>--%>
                </select>
            </td>
            <td class="al_r" width="20%">

            </td>
            <td width="30%">

            </td>
        </tr>
        <tr>
            <td class="al_r" valign="top">
                <label>延迟备注:<font color="red">*</font></label>
            </td>

            <td colspan="3"><textarea style="width: 100%; height: 60px;"
                                      id="etaNotQualifiedMemo">${cbsDelinerPage.etaNotQualifiedMemo}</textarea>
            </td>
        </tr>
        </tbody>
    </table>

</div>
<div class="subtitle">
    <p>签收</p>
    <table class="nobordertable noborder" style="border: none;">
        <tbody>
        <tr>
            <td class="al_r" width="20%">
                <label>签收方式:</label>
            </td>
            <td width="30%">
                ${cbsDelinerPage.signMethod}
            </td>
            <td class="al_r" width="20%">
                <label>签收时间:</label>
            </td>
            <td width="30%">
                <fmt:formatDate value="${cbsDelinerPage.getTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
            </td>
        </tr>
        <tr>
            <td class="al_r" width="20%">
                <label>上传照片:</label>
            </td>
            <td width="30%">
                <c:if test="${zyFileLogEntityListSign!=null}">
                    <c:forEach items="${zyFileLogEntityListSign}" var="zyFileLogEntityList">
                        <span onclick="addOneTab('预览','cbsServiceController.do?openViewFile&fileid=${zyFileLogEntityList.id}')"
                              style="color: blue">${zyFileLogEntityList.oldFileName}</span>
                        <span class="color-blue"><a
                                href="fileUploadController.do?downLoadFile&fileLogId=${zyFileLogEntityList.id}">[下载]</a></span>
                    </c:forEach>
                </c:if>

            </td>
            <td class="al_r" width="20%">

            </td>
            <td width="30%">

            </td>
        </tr>
        <tr>
            <td class="al_r" valign="top"><label>签收备注:</label></td>
            <td colspan="3">
                ${cbsDelinerPage.signMemo}
            </td>
        </tr>
        </tbody>
    </table>
</div>
<div class="subtitle">
    <p>日志</p>
    <table class="ftable">
        <tbody>
        <tr>
            <th>操作人</th>
            <th>时间</th>
            <th>描述</th>
        </tr>
        <c:forEach items="${logisticsLogList}" var="log">
            <tr>

                <td>${log.createName}</td>
                <td><fmt:formatDate value="${log.createDate}" type="date"
                                    pattern="yyyy-MM-dd HH:mm:ss"></fmt:formatDate></td>
                <td>${log.description}</td>

            </tr>
        </c:forEach>
        </tbody>
    </table>
</div>
</body>
</html>
